package es.ats.codington.festival.utils.Query;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

public class JSonQuery {

	 Object obj;
	 JSONObject jsonObject;
	
	
	
	 public JSonQuery() {
		openJson();
		 
	}

	 public void openJson() {
			JSONParser parser=new JSONParser();
			 try {
				obj = parser.parse(new FileReader("src/es/ats/codington/festival/json/JSonQueryDB.json"));
				jsonObject = (JSONObject) obj;
			 } catch (FileNotFoundException e) {
				
				e.printStackTrace();
			} catch (IOException e) {
				
				e.printStackTrace();
			} catch (ParseException e) {
				e.printStackTrace();
			} 
		}
	 
	 //-------------------- Getters of Visitor  ----------------------
     
     public String getInsertPeople (){
             String insertPeople = (String) jsonObject.get("insertPeople");
      return insertPeople;
     }
     
     public String getInsertVisitor (){
             String insertVisitor = (String) jsonObject.get("insertVisitor");
      return insertVisitor;
     }
     
     public String getGetUsername (){
             String getUsername = (String) jsonObject.get("getUsername");
      return getUsername;
     }
     
     public String getLoginVisitor (){
             String loginVisitor = (String) jsonObject.get("loginVisitor");
      return loginVisitor;
     }
     
     public String getGetVisitor (){
             String getVisitor = (String) jsonObject.get("getVisitor");
      return getVisitor;
     }
     
     public String getUpdateVisitor (){
             String updateVisitor = (String) jsonObject.get("updateVisitor");
      return updateVisitor;
     }
     
     public String getIsAdmin (){
             String isAdmin = (String) jsonObject.get("isAdmin");
      return isAdmin;
     }
		
		public String getUpdatePass (){
             String updatePass = (String) jsonObject.get("updatePass");
      return updatePass;
     }
		
      //-------------------- Getters of Event ----------------------
      
     public String getViewEvent (){
             String viewEvent = (String) jsonObject.get("viewEvent");
      return viewEvent;      
      }
     
     public String getViewAllEvent (){
             String viewAllEvent = (String) jsonObject.get("viewAllEvent");
      return viewAllEvent;        
      }
     
     public String getCreateEvent (){
             String createEvent = (String) jsonObject.get("createEvent");
      return createEvent;     
      }
     
     public String getUpdateEvent (){
             String updateEvent = (String) jsonObject.get("updateEvent");
      return updateEvent;     
      }
     
            
     
     //-------------------- Getters of EventSingUp ----------------------
     
     
     public String getSignUpToEvent (){
             String loginVisitor  = (String) jsonObject.get("signUpToEvent");
      return loginVisitor;
      }
     
     
     public String getSelectSeat(){
             String loginVisitor = (String) jsonObject.get("selectSeat");
      return loginVisitor;
      }
     
     public String getUpdateSeat(){
             String loginVisitor = (String) jsonObject.get("updateSeat");
      return loginVisitor;
      }
     
     public String getUnsignUpToEvent(){
             String loginVisitor = (String) jsonObject.get("unsignUpToEvent");
      return loginVisitor;
      }
     
       //-------------------- Getters of Place----------------------
     
     
     public String getCreatePlace (){
             String loginVisitor  = (String) jsonObject.get("createPlace");
      return loginVisitor;
      }
     
     
     public String getSelectName(){
             String loginVisitor = (String) jsonObject.get("selectName");
      return loginVisitor;
      }
     
     public String getUpdatePlace(){
             String loginVisitor = (String) jsonObject.get("updatePlace");
      return loginVisitor;
      }
     
     public String getViewPlace(){
             String loginVisitor = (String) jsonObject.get("viewPlace");
      return loginVisitor;
      }
     
		public String getViewPlaces(){
             String loginVisitor = (String) jsonObject.get("viewPlaces");
      return loginVisitor;
      }
}


